<h1>My Assets and Liabilities</h1>

<?php
# Obtain he JSON data of categories, subcatagories & sub categories label
# Prepare the script for the Generation of the form based on the form fields.
# Set the user asset Data & display it.
?>
<script type="text/javascript">
    var userAssetData   = <?php    echo json_encode($this->userAssetData)   ?>; 
</script>

<div class="add_link"><a href="add-asset">Add New Asset</a></div>
</br></br>

<?php
   
foreach($this->userAssetData as $key=>$val){?>
    <h3><?=$this->catData[$key]?></h3>
    <?php 
        $subcount = 1;
        foreach($val as $key_sub => $val_sub) {?>
        
        <div class="clearfix assetRow">
            <div class="srno"><?=$subcount.'.'?></div>
            <div class="details">
                <div class="h"><?=$this->subcatData[$key_sub]['subcategoryname']?></div>
                
                <div class="desc">
                    <ol>
                    <?php 
                        
                        foreach($val_sub as $label_key => $label_val) 
                        {?> 
                                               
                            <li><?=$this->labelData[$label_key]['labelname']?></li>
                            
                            <?php
                            foreach($label_val as $final_key=>$final_value)
                            {
                                foreach($final_value as $asset_details)
                                {
                                    echo $asset_details['FormFieldName'] . ' : ' . $asset_details['FormFieldValue'] .'<br/>';
                                }
                           ?>
                                <br />
                                <div style="clear:both"></div>
                                <div class="edit_link">
                                    <a href="<?php echo $this->url(array('controller'=> 'index', 'action'=> 'editasset', 'module'=> 'asset' , 'assetid' => $final_key), 'edit-asset', true ) ?>" >Edit</a>
                                    |
                                    <a href="<?php echo $this->url(array('controller'=> 'index', 'action'=> 'deleteasset', 'module'=> 'asset' , 'assetid' => $final_key), 'delete-asset', true ) ?>" >Delete</a>
                                </div>

                       <?php } ?>    
                               <div style="clear:both"></div>                         
                           <?php echo '<br/>';
                            
                        } 
                     ?>
                    </ol>
                </div>
            </div>
            
        </div>
       <?php $subcount++; }?> 
       <br/>
<?php }?>
